/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.mc.dao;

import java.util.Collection;
import java.util.List;

import com.xy.biz.mc.domain.po.UserConnectionPO;
import com.xy.biz.mc.domain.query.UserConnectionQuery;
import com.xy.lang.domain.KeyValue;

/**
 * 
 * 
 * @author zsp
 * @date 2021-2-25
 */
public interface UserConnectionDao {
	
	/**
	 * 保存
	 *
	 * @param userConnectionPO
	 */
	int saveUserConnection(UserConnectionPO userConnectionPO);
	
	/**
	 * 更新
	 *
	 * @param userConnectionPO
	 */
	int updateUserConnection(UserConnectionPO userConnectionPO);
	
	/**
	 * 删除
	 *
	 * @param userId
	 */
	int deleteUserConnection(Long userId);

	/**
	 *
	 * @param userId
	 * @return
	 */
	boolean isUserConnectionExists(Long userId);
	
	/**
	 * 查找一个
	 *
	 * @param userId
	 * @return
	 */
	UserConnectionPO getUserConnection(Long userId);
	
	/**
	 * 查找多条
	 *
	 * @param collection 
	 * @return
	 */
	List<UserConnectionPO> listUserConnectionById(Collection<Long> collection);
	
	/**
	 * 条件查找多条
	 *
	 * @param query 查找条件
	 * @return
	 */
	List<UserConnectionPO> listUserConnection(UserConnectionQuery query);
	
	/**
	 * 条件统计个数
	 *
	 * @param query 查找条件
	 * @return
	 */
	int countUserConnection(UserConnectionQuery query);

	/**
	 *
	 * @param userId
	 * @return
	 */
	Long getServerId(Long userId);

	/**
	 *
	 * @param userIdCollection
	 * @return
	 */
	List<KeyValue<Long, Long>> listServerId(Collection<Long> userIdCollection);

	/**
	 *
	 * @param userGroupId
	 * @return
	 */
	List<KeyValue<Long, Long>> listServerIdByUserGroupId(Long userGroupId);
	
}
